package com.projectName.www.dao;

import com.projectName.www.po.coupons;

import java.sql.ResultSet;

public class S_J_insertcoupons_dao {
    public static boolean insertcou(coupons cou) throws Exception {
        String sql ="insert ignore into coupons (shopname,coupon,num,finaltime) values(?,?,?,?)";
        int i=BaseDao.executeUpdata(sql,cou.getShopname(),cou.getCoupon(),cou.getNum(),cou.getFinaltime());
        if(i>0)return true;
        else  return false;
    }
    public static ResultSet fill() throws Exception {
        String sql="select * from coupons";
        ResultSet resultSet = BaseDao.executeQuery(sql);
        return resultSet;
    }
}
